Schema
Schema builder — fluent API for creating JSON Schema SchemaDefinition values.
Attributes
- Example
-
import org.llm4s.toolapi.Schema val schema = Schema.`object`[Map[String, Any]]("Query parameters") .withProperty(Schema.property("q", Schema.string("Search query"))) .withProperty(Schema.property("limit", Schema.integer("Max results"), required = false)) - Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Schema.type
Members list
Value members
Concrete methods
Create a JSON object schema with no initial properties. Use ObjectSchema.withProperty to add fields.
Create a JSON object schema with no initial properties. Use ObjectSchema.withProperty to add fields.
Value parameters
- description
-
Human-readable description shown to the LLM
Attributes
Create a JSON array schema whose items conform to itemSchema.
Create a JSON array schema whose items conform to itemSchema.
Value parameters
- description
-
Human-readable description shown to the LLM
- itemSchema
-
Schema applied to every element of the array
Attributes
Create a JSON boolean schema.
Create a JSON boolean schema.
Value parameters
- description
-
Human-readable description shown to the LLM
Attributes
Create a JSON integer schema.
Create a JSON integer schema.
Value parameters
- description
-
Human-readable description shown to the LLM
Attributes
Wrap an existing schema to allow null as a valid value.
Wrap an existing schema to allow null as a valid value.
Value parameters
- schema
-
The underlying non-nullable schema
Attributes
Create a JSON number (floating-point) schema.
Create a JSON number (floating-point) schema.
Value parameters
- description
-
Human-readable description shown to the LLM
Attributes
Create a PropertyDefinition for use with ObjectSchema.withProperty.
Create a PropertyDefinition for use with ObjectSchema.withProperty.
Value parameters
- name
-
Property key in the JSON object
- required
-
Whether the property is required (default:
true) - schema
-
Schema for the property value
Attributes
Create a JSON string schema.
Create a JSON string schema.
Value parameters
- description
-
Human-readable description shown to the LLM