JsonSchema

org.llm4s.llmconnect.model.ResponseFormat.JsonSchema
See theJsonSchema companion object
final case class JsonSchema extends ResponseFormat

JSON schema constraint.

Value parameters

name

Schema name for debugging/tracing (OpenAI requires it; max 64 chars). Default "response" for backward compatibility.

schema

JSON schema as ujson value. For OpenAI, the schema is wrapped with name/strict in the provider mapping layer.

strict

When true, model must follow the exact schema (OpenAI strict mode). Default true; set false for partial schema adherence. Build one with JsonSchema.apply and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers.

Attributes

Companion
object
Source
ResponseFormat.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def withName(name: String): JsonSchema

Sets the schema name.

Sets the schema name.

Attributes

Source
ResponseFormat.scala
def withSchema(schema: Value): JsonSchema

Sets the JSON schema.

Sets the JSON schema.

Attributes

Source
ResponseFormat.scala
def withStrict(strict: Boolean): JsonSchema

Sets whether the model must follow the schema exactly.

Sets whether the model must follow the schema exactly.

Attributes

Source
ResponseFormat.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product