Interface OpenAISpec

All Known Implementing Classes:
OpenAICompatiblePromptParameters

public interface OpenAISpec
  • Method Summary

    Modifier and Type
    Method
    Description
    get the JSON schema for the OpenAI spec
     
    void
    setJsonSchema(Class jsonSchema)
    set the JSON schema for the OpenAI spec the given class must be a Java class comforming to the Json Schema specification 2021-12 (Draft 2020-12) if the schema class is set, a response_format block will be gerenated like this:
    void
    setTools(List<Tool> tools)
     
  • Method Details

    • getJsonSchema

      Class getJsonSchema()
      get the JSON schema for the OpenAI spec
      Returns:
    • setJsonSchema

      void setJsonSchema(Class jsonSchema)
      set the JSON schema for the OpenAI spec the given class must be a Java class comforming to the Json Schema specification 2021-12 (Draft 2020-12) if the schema class is set, a response_format block will be gerenated like this:
       "response_format": {
        "type": "json_schema",
        "json_schema": {
        "name": "weather",
        "strict": true,
        "schema": {
          "type": "object",
          "properties": {
            "location": {"type": "string"},
            "temperature": {"type": "number"},
            "conditions": {"type": "string"}
          },
          "required": ["location", "temperature", "conditions"],
          "additionalProperties": false
         }
        }
       }
       
      Parameters:
      jsonSchema -
    • getTools

      List<Tool> getTools()
    • setTools

      void setTools(List<Tool> tools)