{
  "openapi": "3.1.0",
  "info": {
    "title": "David-GPT-2 Text Continuation API",
    "description": "A dedicated causal text-continuation API for the local David-GPT-2 checkpoint. It is not a conventional chat assistant and is separate from the sitewide SOL chat API. Optional retrieval searches the complete configured Sol knowledge index and supplies bounded evidence.",
    "version": "1.0.0"
  },
  "paths": {
    "/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Health Health Get"
                }
              }
            }
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "summary": "Models",
        "operationId": "models_v1_models_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Models V1 Models Get"
                }
              }
            }
          }
        }
      }
    },
    "/v1/speech": {
      "post": {
        "summary": "Speech",
        "operationId": "speech_v1_speech_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Raw local eSpeak PCM WAV",
            "content": {
              "audio/wav": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/continuations": {
      "post": {
        "summary": "Continuations",
        "operationId": "continuations_v1_continuations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContinuationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Continuations V1 Continuations Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContinuationRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 24000,
            "minLength": 1,
            "title": "Prompt"
          },
          "prefix": {
            "type": "string",
            "maxLength": 4000,
            "title": "Prefix",
            "default": ""
          },
          "mode": {
            "type": "string",
            "enum": [
              "david",
              "screenplay"
            ],
            "title": "Mode",
            "default": "david"
          },
          "knowledge": {
            "$ref": "#/components/schemas/KnowledgeOptions"
          },
          "max_tokens": {
            "type": "integer",
            "maximum": 768.0,
            "minimum": 1.0,
            "title": "Max Tokens",
            "default": 200
          },
          "temperature": {
            "type": "number",
            "maximum": 2.0,
            "minimum": 0.0,
            "title": "Temperature",
            "default": 0.8
          },
          "top_p": {
            "type": "number",
            "maximum": 1.0,
            "exclusiveMinimum": 0.0,
            "title": "Top P",
            "default": 0.95
          },
          "top_k": {
            "type": "integer",
            "maximum": 200.0,
            "minimum": 0.0,
            "title": "Top K",
            "default": 50
          },
          "seed": {
            "type": "integer",
            "title": "Seed",
            "default": 37
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "ContinuationRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "KnowledgeOptions": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          },
          "query": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Query"
          },
          "top_k": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Top K",
            "default": 3
          },
          "max_chars_per_hit": {
            "type": "integer",
            "maximum": 2000.0,
            "minimum": 100.0,
            "title": "Max Chars Per Hit",
            "default": 900
          }
        },
        "type": "object",
        "title": "KnowledgeOptions"
      },
      "SpeechRequest": {
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 12000,
            "minLength": 1,
            "title": "Text"
          },
          "speed": {
            "type": "integer",
            "maximum": 220.0,
            "minimum": 80.0,
            "title": "Speed",
            "default": 135
          },
          "pitch": {
            "type": "integer",
            "maximum": 99.0,
            "minimum": 0.0,
            "title": "Pitch",
            "default": 25
          },
          "amplitude": {
            "type": "integer",
            "maximum": 200.0,
            "minimum": 50.0,
            "title": "Amplitude",
            "default": 150
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "SpeechRequest"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
