Class JsonSchema.Builder

java.lang.Object
io.github.stefanbratanov.jvm.openai.JsonSchema.Builder
Enclosing class:
JsonSchema

public static class JsonSchema.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public JsonSchema.Builder name(String name)
      Parameters:
      name - The name of the response format.
    • description

      public JsonSchema.Builder description(String description)
      Parameters:
      description - A description of what the response format is for, used by the model to determine how to respond in the format.
    • schema

      public JsonSchema.Builder schema(Map<String,Object> schema)
      Parameters:
      schema - The schema for the response format, described as a JSON Schema object. The JSON schema should be defined as Map where a value could be a raw escaped JSON String and it will be serialized without escaping.
    • strict

      public JsonSchema.Builder strict(boolean strict)
      Parameters:
      strict - Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
    • build

      public JsonSchema build()