Class JsonSchema
java.lang.Object
nl.dannyj.mistral.models.completion.tool.JsonSchema
Represents the JSON schema definition used within ResponseFormat when type is json_schema.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJsonSchema
(String name, String description, String schema, boolean strict) Creates a newJsonSchema
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSchema.JsonSchemaBuilder
builder()
An optional description of the schema.getName()
The name of the schema.The JSON schema definition, represented as a String.boolean
isStrict()
Whether the schema should be strictly adhered to.void
setDescription
(String description) An optional description of the schema.void
The name of the schema.void
The JSON schema definition, represented as a String.void
setStrict
(boolean strict) Whether the schema should be strictly adhered to.toString()
-
Constructor Details
-
JsonSchema
Creates a newJsonSchema
instance.- Parameters:
name
- The name of the schema.description
- The description of the schema.schema
- The string representing the JSON schema.strict
- Whether the schema is strict.
-
JsonSchema
public JsonSchema()
-
-
Method Details
-
builder
-
getName
The name of the schema.- Returns:
- The name of the schema.
-
getDescription
An optional description of the schema.- Returns:
- The description of the schema.
-
getSchema
The JSON schema definition, represented as a String.- Returns:
- The string representing the JSON schema.
-
isStrict
public boolean isStrict()Whether the schema should be strictly adhered to. Defaults to false.- Returns:
- Whether the schema is strict.
-
setName
The name of the schema.- Parameters:
name
- The name of the schema.
-
setDescription
An optional description of the schema.- Parameters:
description
- The description of the schema.
-
setSchema
The JSON schema definition, represented as a String.- Parameters:
schema
- The string representing the JSON schema.
-
setStrict
public void setStrict(boolean strict) Whether the schema should be strictly adhered to. Defaults to false.- Parameters:
strict
- Whether the schema is strict.
-
toString
-