Class JsonSchema

java.lang.Object
nl.dannyj.mistral.models.completion.tool.JsonSchema

public class JsonSchema extends Object
Represents the JSON schema definition used within ResponseFormat when type is json_schema.
  • Constructor Details

    • JsonSchema

      public JsonSchema(String name, String description, String schema, boolean strict)
      Creates a new JsonSchema 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

      public static JsonSchema.JsonSchemaBuilder builder()
    • getName

      public String getName()
      The name of the schema.
      Returns:
      The name of the schema.
    • getDescription

      public String getDescription()
      An optional description of the schema.
      Returns:
      The description of the schema.
    • getSchema

      public String 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

      public void setName(String name)
      The name of the schema.
      Parameters:
      name - The name of the schema.
    • setDescription

      public void setDescription(String description)
      An optional description of the schema.
      Parameters:
      description - The description of the schema.
    • setSchema

      public void setSchema(String schema)
      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

      public String toString()
      Overrides:
      toString in class Object