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 newJsonSchemainstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSchema.JsonSchemaBuilderbuilder()An optional description of the schema.getName()The name of the schema.The JSON schema definition, represented as a String.booleanisStrict()Whether the schema should be strictly adhered to.voidsetDescription(String description) An optional description of the schema.voidThe name of the schema.voidThe JSON schema definition, represented as a String.voidsetStrict(boolean strict) Whether the schema should be strictly adhered to.toString()
-
Constructor Details
-
JsonSchema
Creates a newJsonSchemainstance.- 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
-