Class OpenAICompatiblePromptParameters

java.lang.Object
rocks.imsofa.ai.puppychatter.PromptParameters
rocks.imsofa.ai.puppychatter.openai.OpenAICompatiblePromptParameters
All Implemented Interfaces:
OpenAISpec

public class OpenAICompatiblePromptParameters extends PromptParameters implements OpenAISpec
  • Field Details

    • jsonSchema

      protected Class jsonSchema
    • tools

      protected List<Tool> tools
  • Constructor Details

    • OpenAICompatiblePromptParameters

      public OpenAICompatiblePromptParameters(String role)
  • Method Details

    • getJsonSchema

      public Class getJsonSchema()
      Description copied from interface: OpenAISpec
      get the JSON schema for the OpenAI spec
      Specified by:
      getJsonSchema in interface OpenAISpec
      Returns:
    • setJsonSchema

      public void setJsonSchema(Class jsonSchema)
      Description copied from interface: OpenAISpec
      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
         }
        }
       }
       
      Specified by:
      setJsonSchema in interface OpenAISpec
      Parameters:
      jsonSchema -
    • getTools

      public List<Tool> getTools()
      Specified by:
      getTools in interface OpenAISpec
    • setTools

      public void setTools(List<Tool> tools)
      Specified by:
      setTools in interface OpenAISpec