RawJsonSchema

org.llm4s.toolapi.RawJsonSchema
See theRawJsonSchema companion object
@Stable
final case class RawJsonSchema extends SchemaDefinition[Value]

A JSON Schema written out as JSON, for what the other cases cannot express: $ref, oneOf, pattern, a free-form object, a schema received from elsewhere (an MCP server's).

It is emitted as it was written, whatever strict is: nothing in it is made required or nullable. Whether a provider accepts it, and whether an agent's argument validator supports its keywords, is for the caller to know.

Value parameters

json

The JSON Schema, an object

Attributes

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

Members list

Value members

Concrete methods

def json: Obj

The JSON Schema; a fresh copy each call, since ujson values are mutable.

The JSON Schema; a fresh copy each call, since ujson values are mutable.

Attributes

Source
SchemaDefinition.scala
def toJsonSchema(strict: Boolean): Value

Serialise this schema to a JSON Schema ujson.Value.

Serialise this schema to a JSON Schema ujson.Value.

Value parameters

strict

When true, all object properties are listed as required and the optional ones accept null, matching OpenAI strict-mode tool definitions.

Attributes

Source
SchemaDefinition.scala
def withJson(json: Obj): RawJsonSchema

Replace the JSON Schema.

Replace the JSON Schema.

Attributes

Source
SchemaDefinition.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product