Json

data class Json(val schema: JsonObject? = null) : ResponseFormat

A JSON object.

With no schema, OpenAI receives JSON object mode and Ollama receives format: "json". With a schema, OpenAI receives JSON schema mode and Ollama receives the schema as format.

Constructors

Link copied to clipboard
constructor(schema: JsonObject? = null)

Properties

Link copied to clipboard
val schema: JsonObject?

Optional JSON schema that the object must match.